//
//  MHRedPacketOrderRecordViewController.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/11/4.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHRedPacketOrderRecordViewController.h"
#import "MHRedPacketOrderViewModel.h"
#import "MHRedPacketOrderRecordCell.h"
#import "MHRedHistoryRecord.h"
@interface MHRedPacketOrderRecordViewController ()
@property(nonatomic, strong) MHRedPacketOrderViewModel *viewModel;
@end

@implementation MHRedPacketOrderRecordViewController
@dynamic viewModel;

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView registerClass:[MHRedPacketOrderRecordCell class] forCellReuseIdentifier:NSStringFromClass([MHRedPacketOrderRecordCell class])];
    
    self.view.backgroundColor = MHColorFromHexString(@"#F5F5F5");
}




-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    MHRedPacketOrderRecordCell *cell =  [tableView dequeueReusableCellWithIdentifier:@"MHRedPacketOrderRecordCell"];
    MHRedHistoryRecord *model   = self.viewModel.dataSource[indexPath.row];
    [cell bindViewModel:model];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 10;
}


-(UIEdgeInsets)contentInset
{
    return UIEdgeInsetsMake(0, 0, 0, 0);
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 102;
}



@end
